package Frame.screen;

import FCRendering.FCRConstants;
import FCRendering.FCRMaster;
import FCRendering.ImageUtil;

import java.awt.*;

import static FCRendering.FCRMaster.fcv;

//留声机
public class PhonographScreen extends IScreen{
    Font font6;
    @Override
    public void dispatchPaintComponent(Graphics g, FCRMaster fcrMaster) {
        // 渲染留声机
        if (fcv.isOpenPhonograph()) {
            g.setFont(font6);
            g.drawImage(ImageUtil.getImage("gamephonographframe"), (int) (560 * fcv.getProportion()),
                    (int) (240 * fcv.getProportion()), (int) (800 * fcv.getProportion()), (int) (600 * fcv.getProportion()), this);
            for (int i = 0; i < fcv.getPhonographMusicName().size(); i++)
                g.drawString(fcrMaster.getLangLib().getNameOfId(fcv.getPhonographMusicName().get(i)), (int) (860 * fcv.getProportion()),
                        (int) ((610 + 32 * i) * fcv.getProportion()));
            if (fcv.getPhonographEnterNum() > -1)
                g.drawImage(ImageUtil.getImage("gameitemshou"), (int) (820 * fcv.getProportion()),
                        (int) ((583 + 32 * fcv.getPhonographEnterNum()) * fcv.getProportion()), (int) (32 * fcv.getProportion()),
                        (int) (32 * fcv.getProportion()), this);
        }
    }

    @Override
    protected void setBounds() {
        font6 = new Font(FCRConstants.FONT_ELEGANT_BLACK, 0, 30);
    }
}
